<?php
/**
 * SDCategoryRecommendationV33
 *
 * PHP version 5
 *
 * @category Class
 * @package  AmazonAdvertisingApi
 * @author   vv_guo
 * @link    https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 */

/**
 * Amazon Ads API for Sponsored Display
 *
 * This API enables programmatic access for campaign creation, management, and reporting for Sponsored Display campaigns. For more information on the functionality, see the [Sponsored Display Support Center](https://advertising.amazon.com/help#GTPPHE6RAWC2C4LZ). For API onboarding information, see the [account setup](https://advertising.amazon.com/API/docs/en-us/guides/onboarding/overview) topic.<br/><br/> > This specification is available for download from the **[Advertising API developer portal](https://d3a0d0y2hgofx6.cloudfront.net/openapi/en-us/sponsored-display/3-0/openapi.yaml).**
 *
 * OpenAPI spec version: 3.0
 * 
 * Generated by:https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api.git
 * AmazonAdvertisingApi Codegen version: 3.0.51
 */
/**
 * NOTE: This class is auto generated by the AmazonAdvertisingApi code generator program.
 *https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 * Do not edit the class manually.
 */

namespace AmazonAdvertisingApi\Model;

use \ArrayAccess;
use \AmazonAdvertisingApi\ObjectSerializer;

/**
 * SDCategoryRecommendationV33 Class Doc Comment
 *
 * @category Class
 * @description A recommended category to target ads on
 * @package  AmazonAdvertisingApi
 * @author   vv_guo
 * @link    https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 */
class SDCategoryRecommendationV33 implements ModelInterface, ArrayAccess
{
    const DISCRIMINATOR = null;

    /**
      * The original name of the model.
      *
      * @var string
      */
    protected static $AmazonAdvertisingApiModelName = 'SDCategoryRecommendationV33';

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $AmazonAdvertisingApiTypes = [
        'category' => '\AmazonAdvertisingApi\Model\SDCategory',
        'name' => 'string',
        'translated_name' => 'string',
        'path' => 'string[]',
        'translated_path' => 'string[]',
        'targetable_asin_count_range' => '\AmazonAdvertisingApi\Model\SDCategoryRecommendationV33TargetableAsinCountRange',
        'rank' => 'int'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $AmazonAdvertisingApiFormats = [
        'category' => null,
        'name' => null,
        'translated_name' => null,
        'path' => null,
        'translated_path' => null,
        'targetable_asin_count_range' => null,
        'rank' => null
    ];

    /**
     * Array of property to type mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function AmazonAdvertisingApiTypes()
    {
        return self::$AmazonAdvertisingApiTypes;
    }

    /**
     * Array of property to format mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function AmazonAdvertisingApiFormats()
    {
        return self::$AmazonAdvertisingApiFormats;
    }

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'category' => 'category',
        'name' => 'name',
        'translated_name' => 'translatedName',
        'path' => 'path',
        'translated_path' => 'translatedPath',
        'targetable_asin_count_range' => 'targetableAsinCountRange',
        'rank' => 'rank'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'category' => 'setCategory',
        'name' => 'setName',
        'translated_name' => 'setTranslatedName',
        'path' => 'setPath',
        'translated_path' => 'setTranslatedPath',
        'targetable_asin_count_range' => 'setTargetableAsinCountRange',
        'rank' => 'setRank'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'category' => 'getCategory',
        'name' => 'getName',
        'translated_name' => 'getTranslatedName',
        'path' => 'getPath',
        'translated_path' => 'getTranslatedPath',
        'targetable_asin_count_range' => 'getTargetableAsinCountRange',
        'rank' => 'getRank'
    ];

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @return array
     */
    public static function attributeMap()
    {
        return self::$attributeMap;
    }

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @return array
     */
    public static function setters()
    {
        return self::$setters;
    }

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @return array
     */
    public static function getters()
    {
        return self::$getters;
    }

    /**
     * The original name of the model.
     *
     * @return string
     */
    public function getModelName()
    {
        return self::$AmazonAdvertisingApiModelName;
    }



    /**
     * Associative array for storing property values
     *
     * @var mixed[]
     */
    protected $container = [];

    /**
     * Constructor
     *
     * @param mixed[] $data Associated array of property values
     *                      initializing the model
     */
    public function __construct(array $data = null)
    {
        $this->container['category'] = isset($data['category']) ? $data['category'] : null;
        $this->container['name'] = isset($data['name']) ? $data['name'] : null;
        $this->container['translated_name'] = isset($data['translated_name']) ? $data['translated_name'] : null;
        $this->container['path'] = isset($data['path']) ? $data['path'] : null;
        $this->container['translated_path'] = isset($data['translated_path']) ? $data['translated_path'] : null;
        $this->container['targetable_asin_count_range'] = isset($data['targetable_asin_count_range']) ? $data['targetable_asin_count_range'] : null;
        $this->container['rank'] = isset($data['rank']) ? $data['rank'] : null;
    }

    /**
     * Show all the invalid properties with reasons.
     *
     * @return array invalid properties with reasons
     */
    public function listInvalidProperties()
    {
        $invalidProperties = [];

        return $invalidProperties;
    }

    /**
     * Validate all the properties in the model
     * return true if all passed
     *
     * @return bool True if all properties are valid
     */
    public function valid()
    {
        return count($this->listInvalidProperties()) === 0;
    }


    /**
     * Gets category
     *
     * @return \AmazonAdvertisingApi\Model\SDCategory
     */
    public function getCategory()
    {
        return $this->container['category'];
    }

    /**
     * Sets category
     *
     * @param \AmazonAdvertisingApi\Model\SDCategory $category category
     *
     * @return $this
     */
    public function setCategory($category)
    {
        $this->container['category'] = $category;

        return $this;
    }

    /**
     * Gets name
     *
     * @return string
     */
    public function getName()
    {
        return $this->container['name'];
    }

    /**
     * Sets name
     *
     * @param string $name The category name
     *
     * @return $this
     */
    public function setName($name)
    {
        $this->container['name'] = $name;

        return $this;
    }

    /**
     * Gets translated_name
     *
     * @return string
     */
    public function getTranslatedName()
    {
        return $this->container['translated_name'];
    }

    /**
     * Sets translated_name
     *
     * @param string $translated_name The translated category name by requested locale, field will not be provided if locale is not provided or campaign localization service is down.
     *
     * @return $this
     */
    public function setTranslatedName($translated_name)
    {
        $this->container['translated_name'] = $translated_name;

        return $this;
    }

    /**
     * Gets path
     *
     * @return string[]
     */
    public function getPath()
    {
        return $this->container['path'];
    }

    /**
     * Sets path
     *
     * @param string[] $path The path of the category within the category catalogue.
     *
     * @return $this
     */
    public function setPath($path)
    {
        $this->container['path'] = $path;

        return $this;
    }

    /**
     * Gets translated_path
     *
     * @return string[]
     */
    public function getTranslatedPath()
    {
        return $this->container['translated_path'];
    }

    /**
     * Sets translated_path
     *
     * @param string[] $translated_path The translated path of the category within the category catalogue by requested locale, field will not be provided if locale is not provided or campaign localization is down.
     *
     * @return $this
     */
    public function setTranslatedPath($translated_path)
    {
        $this->container['translated_path'] = $translated_path;

        return $this;
    }

    /**
     * Gets targetable_asin_count_range
     *
     * @return \AmazonAdvertisingApi\Model\SDCategoryRecommendationV33TargetableAsinCountRange
     */
    public function getTargetableAsinCountRange()
    {
        return $this->container['targetable_asin_count_range'];
    }

    /**
     * Sets targetable_asin_count_range
     *
     * @param \AmazonAdvertisingApi\Model\SDCategoryRecommendationV33TargetableAsinCountRange $targetable_asin_count_range targetable_asin_count_range
     *
     * @return $this
     */
    public function setTargetableAsinCountRange($targetable_asin_count_range)
    {
        $this->container['targetable_asin_count_range'] = $targetable_asin_count_range;

        return $this;
    }

    /**
     * Gets rank
     *
     * @return int
     */
    public function getRank()
    {
        return $this->container['rank'];
    }

    /**
     * Sets rank
     *
     * @param int $rank A rank to signify which recommendations are weighed more heavily, with a lower rank signifying a stronger recommendation.
     *
     * @return $this
     */
    public function setRank($rank)
    {
        $this->container['rank'] = $rank;

        return $this;
    }
    /**
     * Returns true if offset exists. False otherwise.
     *
     * @param integer $offset Offset
     *
     * @return boolean
     */
    #[\ReturnTypeWillChange]
    public function offsetExists($offset)
    {
        return isset($this->container[$offset]);
    }

    /**
     * Gets offset.
     *
     * @param integer $offset Offset
     *
     * @return mixed
     */
    #[\ReturnTypeWillChange]
    public function offsetGet($offset)
    {
        return isset($this->container[$offset]) ? $this->container[$offset] : null;
    }

    /**
     * Sets value based on offset.
     *
     * @param integer $offset Offset
     * @param mixed   $value  Value to be set
     *
     * @return void
     */
    #[\ReturnTypeWillChange]
    public function offsetSet($offset, $value)
    {
        if (is_null($offset)) {
            $this->container[] = $value;
        } else {
            $this->container[$offset] = $value;
        }
    }

    /**
     * Unsets offset.
     *
     * @param integer $offset Offset
     *
     * @return void
     */
    #[\ReturnTypeWillChange]
    public function offsetUnset($offset)
    {
        unset($this->container[$offset]);
    }

    /**
     * Gets the string presentation of the object
     *
     * @return string
     */
    public function __toString()
    {
        if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
            return json_encode(
                ObjectSerializer::sanitizeForSerialization($this),
                JSON_PRETTY_PRINT
            );
        }

        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
    }
}
